package com.qidianit.mes.pro.controller;

import com.github.pagehelper.PageInfo;
import com.qidianit.mes.pojo.ProductionOrder;
import com.qidianit.mes.pojo.Result;
import com.qidianit.mes.pojo.Workflow;
import com.qidianit.mes.pro.service.ProScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ Description:
 * @ Author:WuJingLei
 * @ Date: 2025/9/24 -9:32
 */
@RestController
@RequestMapping("/proSchedule")
public class ProScheduleController {
    @Autowired
    private ProScheduleService proScheduleService;

    @GetMapping("/page")
    public Result<PageInfo<ProductionOrder>> schedule(ProductionOrder productionOrder, @RequestParam(defaultValue = "1")int pageNum,
                                                      @RequestParam(defaultValue = "10")int size ){
        return proScheduleService.queryListByStatus(productionOrder,pageNum,size);
    }
    @GetMapping("/getWorkflows")
    public Result<List<Workflow>> getWorkflows(String code){
        return proScheduleService.getMaterialWorkflowList(code);
    }

}
